package _022_2_15

func twoSum(nums []int, target int) []int {
	m := map[int]int{}

	for i := 0; i < len(nums); i++ {
		m[nums[i]] = i
	}

	for i := 0; i < len(nums); i++ {
		k, ok := m[target-nums[i]]

		if ok && k != i {
			return []int{i, k}
		}
	}

	return nil

}
